package com.lingshu.app.utils;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
import com.bumptech.glide.request.RequestOptions;
import com.lingshu.app.R;
import com.lingshu.app.config.App;

import jp.wasabeef.glide.transformations.BlurTransformation;

/**
 * @author 于定金
 * @version 1.0
 * @Date 2024/1/11 10:46
 * @Description
 */
public class GlideUtils {
    public static void loadImageWithDefault(ImageView imageView, String url) {
        RequestOptions options = new RequestOptions();
        options.placeholder(R.mipmap.ic_logo).error(R.mipmap.ic_logo).fallback(R.mipmap.ic_logo).transform(new CircleCrop());

        Glide.with(App.getContext()).load(url).apply(options).into(imageView);
    }

    public static void loadImageWithGoss(ImageView imageView, String url) {
        Glide.with(App.getContext()).load(url).apply(RequestOptions.bitmapTransform(new BlurTransformation(25, 3))).into(imageView);
    }
}
